package com.tag;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class SimpleTagTest5 extends SimpleTagSupport{
	
	private List movieList;
	
	
	public void setMovieList(List movieList) {
		this.movieList = movieList;
	}


	public void doTag() throws JspException, IOException{
		Iterator i = movieList.iterator();
		while(i.hasNext()){
			Movie movie = (Movie) i.next();
			getJspContext().setAttribute("movie", movie);
			getJspBody().invoke(null);
		
		}
		
	/*	//태그 로직
		getJspContext().getOut().write("hello"+ user + "<br>");
		getJspContext().getOut().write("Your advice is : "+ getAdvice());
		
	//	getJspBody().invoke(null); 태그가 몸체를 갖는 경우를 에 사용하게 됨 
		//인자가 널인 것은 writer말고 response 로  출력하라는 뜻임 . 
*/	}
	

}
